aboutsummaryrefslogtreecommitdiff
path: root/src/routes/user/[user]/+page.ts
blob: c84caafb704b54f6a3cc9b1e5648fc8b3602f37f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { load_Profile } from '$houdini';
import { user } from '$lib/Data/AniList/user';
import type { LoadEvent } from '@sveltejs/kit';

export const load = async (event: LoadEvent) => {
	const username = event.params.user as string;
	const userData = await user(username, /^\d+$/.test(username));

	return {
		...(await load_Profile({
			event,
			variables: {
				id: userData.id
			}
		})),
		username,
		userData
	};
};